package com.hwua.tonyshop.criteria;
	
import com.slkj.autocode.entity.Page;
import com.hwua.tonyshop.entity.pojo.LocationOption;

/**
* 
* @author sunny Yang [杨松彦]
* @QQ 550358261
* @date 2018-04-16
* @discribe
* >、<、>=、<=、=、!=、like、
* is null、is not null、in、not in
*
*/
public class LocationOptionCriteria extends LocationOption{
	/**
	* 版本号
	*/
	private static final long serialVersionUID = 1L;
	private String groupBy123;//分组
	private String having123;//分组过滤
	private String orderBy123;//排序
	private Page page123;
	private String condition123="";//纯条件
	private String selectCondition123;//查询条件
	private String sql123;
	private LocationOption locationOption;
	private String feid123;//字段用于统计查询时设置

	public LocationOptionCriteria() {

	}
	public String getFeid123() {
		return feid123;
	}
	public void setFeid123(String feid) {
		this.feid123 = feid;
	}
	public LocationOption getLocationOption() {
		return locationOption;
	}
	public void setLocationOption(LocationOption locationOption) {
		this.locationOption = locationOption;
		initLocationOption(locationOption);
	}

	public String getSql123() {
		return sql123;
	}

	public void setSql123(String sql123) {
		this.sql123 = sql123;
	}

	public String getSelectCondition123() {
		if(selectCondition123==null){
			if(condition123.trim().length()>0){
				condition123 = "where "+condition123;
			}
			selectCondition123 = condition123;
			if(groupBy123!=null){
				selectCondition123 += " group by "+groupBy123+" ";
			}
			if(having123!=null){
				selectCondition123 += "having "+having123+" ";
			}
			if(orderBy123!=null){
				selectCondition123 += "order by "+orderBy123+" ";
			}
			if(page123!=null){
				selectCondition123 += "limit "+((page123.getPageNumber()-1)*page123.getPageSize())+","+page123.getPageSize();
			}
			selectCondition123 = selectCondition123.trim();
		}
		System.out.println("查询条件："+selectCondition123);
		return selectCondition123;
	}
	public void setSelectCondition123(String selectCondition) {
		this.selectCondition123 = selectCondition;
	}
	public String getCondition123() {
		System.out.println("纯条件："+condition123);
		return condition123;
	}
	public void setCondition123(String condition) {
		this.condition123 = condition;
	}
	public LocationOptionCriteria page(Page value){
		page123 = value;
		return this;
	}
	public LocationOptionCriteria groupBy(String value){
		groupBy123 = value;
		return this;
	}
	public LocationOptionCriteria having(String value){
		having123 = value;
		return this;
	}
	public LocationOptionCriteria orderBy(String value){
		orderBy123 = value;
		return this;
	}

	/*public String getSqlAll(String tableName){
		String sql = "";
		if("where ".equals(condition123)){
			sql = "select * from `"+tableName+"` ";
		}else{
			sql = "select * from `"+tableName+"` "+condition123+" ";
		}
		if(groupBy123!=null){
			sql += sql+" group by "+groupBy123+" ";
		}
		if(having123!=null){
			sql += "having "+having123+" ";
		}
		if(orderBy123!=null){
			sql += "order by "+orderBy123+" ";
		}
		if(page123!=null){
			sql += "limit "+((page123.getPageNumber()-1)*page123.getPageSize())+","+page123.getPageSize();
		}
		sql = sql.trim();
		return sql; 
	}*/

/************以下为纯条件的拼接*******************/

	public LocationOptionCriteria andIdEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`="+id+" ";
			}else{
				condition123 += "`id`="+id+" ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria orIdEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`="+id+" ";
			}else{
				condition123 += "`id`="+id+" ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andIdNotEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`!="+id+" ";
			}else{
				condition123 += "`id`!="+id+" ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orIdNotEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`!="+id+" ";
			}else{
				condition123 += "`id`!="+id+" ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public LocationOptionCriteria andIdGreaterThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`>"+id+" ";
			}else{
				condition123 += "`id`>"+id+" ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orIdGreaterThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`>"+id+" ";
			}else{
				condition123 += "`id`>"+id+" ";
			}
		}
		return this;
	}
	
	
	public LocationOptionCriteria andIdLessThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`<"+id+" ";
			}else{
				condition123 += "`id`<"+id+" ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orIdLessThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`<"+id+" ";
			}else{
				condition123 += "`id`<"+id+" ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andIdGreadterThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`>="+id+" ";
			}else{
				condition123 += "`id`>="+id+" ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orIdGreadterThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`>="+id+" ";
			}else{
				condition123 += "`id`>="+id+" ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andIdLessThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`<="+id+" ";
			}else{
				condition123 += "`id`<="+id+" ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orIdLessThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`<="+id+" ";
			}else{
				condition123 += "`id`<="+id+" ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andIdLike(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id` like "+id+" ";
			}else{
				condition123 += "`id` like "+id+" ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orIdLike(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id` like "+id+" ";
			}else{
				condition123 += "`id` like "+id+" ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andIdIsNull(){
			if(condition123.length()>0){
				condition123 += "and `id` is null";
			}else{
				condition123 += "`id` is null";
			}
		return this;
	}
	public LocationOptionCriteria orIdIsNull(){
		if(condition123.length()>0){
			condition123 += "or `id` is null";
		}else{
			condition123 += "`id` is null";
		}
		return this;
	}
	public LocationOptionCriteria andIdIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `id` is not null";
		}else{
			condition123 += "`id` is not null";
		}
		return this;
	}
	public LocationOptionCriteria orIdIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `id` is not null";
		}else{
			condition123 += "`id` is not null";
		}
		return this;
	}
	public LocationOptionCriteria andIdIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `id` in("+value+") ";
			}else{
				condition123 += "`id` in("+value+") ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orIdIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `id` in("+value+") ";
			}else{
				condition123 += "`id` in("+value+") ";
			}
		}
		return this;
	}
	public LocationOptionCriteria andIdNotIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `id` not in("+value+") ";
			}else{
				condition123 += "`id` not in("+value+") ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orIdNotIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `id` not in("+value+") ";
			}else{
				condition123 += "`id` not in("+value+") ";
			}
		}
		return this;
	}

	public LocationOptionCriteria andNameEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`='"+name+"' ";
			}else{
				condition123 += "`name`='"+name+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria orNameEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`='"+name+"' ";
			}else{
				condition123 += "`name`='"+name+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andNameNotEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`!='"+name+"' ";
			}else{
				condition123 += "`name`!='"+name+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orNameNotEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`!='"+name+"' ";
			}else{
				condition123 += "`name`!='"+name+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public LocationOptionCriteria andNameGreaterThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`>'"+name+"' ";
			}else{
				condition123 += "`name`>'"+name+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orNameGreaterThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`>'"+name+"' ";
			}else{
				condition123 += "`name`>'"+name+"' ";
			}
		}
		return this;
	}
	
	
	public LocationOptionCriteria andNameLessThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`<'"+name+"' ";
			}else{
				condition123 += "`name`<'"+name+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orNameLessThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`<'"+name+"' ";
			}else{
				condition123 += "`name`<'"+name+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andNameGreadterThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`>='"+name+"' ";
			}else{
				condition123 += "`name`>='"+name+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orNameGreadterThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`>='"+name+"' ";
			}else{
				condition123 += "`name`>='"+name+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andNameLessThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`<='"+name+"' ";
			}else{
				condition123 += "`name`<='"+name+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orNameLessThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`<='"+name+"' ";
			}else{
				condition123 += "`name`<='"+name+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andNameLike(String name){
		if(name!=null&&name.trim().length()>0&&!("%".equals(name.trim()))&&!("%%".equals(name.trim()))){
			if(condition123.length()>0){
				condition123 += "and `name` like '"+name+"' ";
			}else{
				condition123 += "`name` like '"+name+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orNameLike(String name){
		if(name!=null&&name.trim().length()>0&&!("%".equals(name.trim()))&&!("%%".equals(name.trim()))){
			if(condition123.length()>0){
				condition123 += "or `name` like '"+name+"' ";
			}else{
				condition123 += "`name` like '"+name+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andNameIsNull(){
			if(condition123.length()>0){
				condition123 += "and `name` is null";
			}else{
				condition123 += "`name` is null";
			}
		return this;
	}
	public LocationOptionCriteria orNameIsNull(){
		if(condition123.length()>0){
			condition123 += "or `name` is null";
		}else{
			condition123 += "`name` is null";
		}
		return this;
	}
	public LocationOptionCriteria andNameIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `name` is not null";
		}else{
			condition123 += "`name` is not null";
		}
		return this;
	}
	public LocationOptionCriteria orNameIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `name` is not null";
		}else{
			condition123 += "`name` is not null";
		}
		return this;
	}
	
	public LocationOptionCriteria andNameIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `name` in("+value+") ";
			}else{
				condition123 += "`name` in("+value+") ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria orNameIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `name` in("+value+") ";
			}else{
				condition123 += "`name` in("+value+") ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andNameNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `name` not in("+value+") ";
			}else{
				condition123 += "`name` not in("+value+") ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria orNameNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `name` not in("+value+") ";
			}else{
				condition123 += "`name` not in("+value+") ";
			}
		}
		return this;
	}

	public LocationOptionCriteria andUseTypeEquals(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_type`='"+useType+"' ";
			}else{
				condition123 += "`use_type`='"+useType+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria orUseTypeEquals(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_type`='"+useType+"' ";
			}else{
				condition123 += "`use_type`='"+useType+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseTypeNotEquals(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_type`!='"+useType+"' ";
			}else{
				condition123 += "`use_type`!='"+useType+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseTypeNotEquals(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_type`!='"+useType+"' ";
			}else{
				condition123 += "`use_type`!='"+useType+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public LocationOptionCriteria andUseTypeGreaterThan(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_type`>'"+useType+"' ";
			}else{
				condition123 += "`use_type`>'"+useType+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseTypeGreaterThan(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_type`>'"+useType+"' ";
			}else{
				condition123 += "`use_type`>'"+useType+"' ";
			}
		}
		return this;
	}
	
	
	public LocationOptionCriteria andUseTypeLessThan(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_type`<'"+useType+"' ";
			}else{
				condition123 += "`use_type`<'"+useType+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseTypeLessThan(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_type`<'"+useType+"' ";
			}else{
				condition123 += "`use_type`<'"+useType+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseTypeGreadterThanAndEquals(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_type`>='"+useType+"' ";
			}else{
				condition123 += "`use_type`>='"+useType+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseTypeGreadterThanAndEquals(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_type`>='"+useType+"' ";
			}else{
				condition123 += "`use_type`>='"+useType+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseTypeLessThanAndEquals(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_type`<='"+useType+"' ";
			}else{
				condition123 += "`use_type`<='"+useType+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseTypeLessThanAndEquals(String useType){
		if(useType!=null&&useType.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_type`<='"+useType+"' ";
			}else{
				condition123 += "`use_type`<='"+useType+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseTypeLike(String useType){
		if(useType!=null&&useType.trim().length()>0&&!("%".equals(useType.trim()))&&!("%%".equals(useType.trim()))){
			if(condition123.length()>0){
				condition123 += "and `use_type` like '"+useType+"' ";
			}else{
				condition123 += "`use_type` like '"+useType+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseTypeLike(String useType){
		if(useType!=null&&useType.trim().length()>0&&!("%".equals(useType.trim()))&&!("%%".equals(useType.trim()))){
			if(condition123.length()>0){
				condition123 += "or `use_type` like '"+useType+"' ";
			}else{
				condition123 += "`use_type` like '"+useType+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseTypeIsNull(){
			if(condition123.length()>0){
				condition123 += "and `use_type` is null";
			}else{
				condition123 += "`use_type` is null";
			}
		return this;
	}
	public LocationOptionCriteria orUseTypeIsNull(){
		if(condition123.length()>0){
			condition123 += "or `use_type` is null";
		}else{
			condition123 += "`use_type` is null";
		}
		return this;
	}
	public LocationOptionCriteria andUseTypeIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `use_type` is not null";
		}else{
			condition123 += "`use_type` is not null";
		}
		return this;
	}
	public LocationOptionCriteria orUseTypeIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `use_type` is not null";
		}else{
			condition123 += "`use_type` is not null";
		}
		return this;
	}
	
	public LocationOptionCriteria andUseTypeIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `use_type` in("+value+") ";
			}else{
				condition123 += "`use_type` in("+value+") ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria orUseTypeIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `use_type` in("+value+") ";
			}else{
				condition123 += "`use_type` in("+value+") ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseTypeNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `use_type` not in("+value+") ";
			}else{
				condition123 += "`use_type` not in("+value+") ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria orUseTypeNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `use_type` not in("+value+") ";
			}else{
				condition123 += "`use_type` not in("+value+") ";
			}
		}
		return this;
	}

	public LocationOptionCriteria andUseValueEquals(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_value`='"+useValue+"' ";
			}else{
				condition123 += "`use_value`='"+useValue+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria orUseValueEquals(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_value`='"+useValue+"' ";
			}else{
				condition123 += "`use_value`='"+useValue+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseValueNotEquals(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_value`!='"+useValue+"' ";
			}else{
				condition123 += "`use_value`!='"+useValue+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseValueNotEquals(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_value`!='"+useValue+"' ";
			}else{
				condition123 += "`use_value`!='"+useValue+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public LocationOptionCriteria andUseValueGreaterThan(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_value`>'"+useValue+"' ";
			}else{
				condition123 += "`use_value`>'"+useValue+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseValueGreaterThan(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_value`>'"+useValue+"' ";
			}else{
				condition123 += "`use_value`>'"+useValue+"' ";
			}
		}
		return this;
	}
	
	
	public LocationOptionCriteria andUseValueLessThan(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_value`<'"+useValue+"' ";
			}else{
				condition123 += "`use_value`<'"+useValue+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseValueLessThan(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_value`<'"+useValue+"' ";
			}else{
				condition123 += "`use_value`<'"+useValue+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseValueGreadterThanAndEquals(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_value`>='"+useValue+"' ";
			}else{
				condition123 += "`use_value`>='"+useValue+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseValueGreadterThanAndEquals(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_value`>='"+useValue+"' ";
			}else{
				condition123 += "`use_value`>='"+useValue+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseValueLessThanAndEquals(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `use_value`<='"+useValue+"' ";
			}else{
				condition123 += "`use_value`<='"+useValue+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseValueLessThanAndEquals(String useValue){
		if(useValue!=null&&useValue.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `use_value`<='"+useValue+"' ";
			}else{
				condition123 += "`use_value`<='"+useValue+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseValueLike(String useValue){
		if(useValue!=null&&useValue.trim().length()>0&&!("%".equals(useValue.trim()))&&!("%%".equals(useValue.trim()))){
			if(condition123.length()>0){
				condition123 += "and `use_value` like '"+useValue+"' ";
			}else{
				condition123 += "`use_value` like '"+useValue+"' ";
			}
		}
		return this;
	}
	public LocationOptionCriteria orUseValueLike(String useValue){
		if(useValue!=null&&useValue.trim().length()>0&&!("%".equals(useValue.trim()))&&!("%%".equals(useValue.trim()))){
			if(condition123.length()>0){
				condition123 += "or `use_value` like '"+useValue+"' ";
			}else{
				condition123 += "`use_value` like '"+useValue+"' ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseValueIsNull(){
			if(condition123.length()>0){
				condition123 += "and `use_value` is null";
			}else{
				condition123 += "`use_value` is null";
			}
		return this;
	}
	public LocationOptionCriteria orUseValueIsNull(){
		if(condition123.length()>0){
			condition123 += "or `use_value` is null";
		}else{
			condition123 += "`use_value` is null";
		}
		return this;
	}
	public LocationOptionCriteria andUseValueIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `use_value` is not null";
		}else{
			condition123 += "`use_value` is not null";
		}
		return this;
	}
	public LocationOptionCriteria orUseValueIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `use_value` is not null";
		}else{
			condition123 += "`use_value` is not null";
		}
		return this;
	}
	
	public LocationOptionCriteria andUseValueIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `use_value` in("+value+") ";
			}else{
				condition123 += "`use_value` in("+value+") ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria orUseValueIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `use_value` in("+value+") ";
			}else{
				condition123 += "`use_value` in("+value+") ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria andUseValueNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `use_value` not in("+value+") ";
			}else{
				condition123 += "`use_value` not in("+value+") ";
			}
		}
		return this;
	}
	
	public LocationOptionCriteria orUseValueNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `use_value` not in("+value+") ";
			}else{
				condition123 += "`use_value` not in("+value+") ";
			}
		}
		return this;
	}

	private void initLocationOption(LocationOption locationOption) {
		super.setId(locationOption.getId());
		super.setName(locationOption.getName());
		super.setUseType(locationOption.getUseType());
		super.setUseValue(locationOption.getUseValue());

	}

}